#include "StringWrap.h"
#include <QHash>
namespace clojure_lang {

StringWrap::StringWrap(QString v)
{
    this->val = v;
}

StringWrap::StringWrap(QString v, IPersistentMap *meta)
{
    this->_meta = meta;
    this->val = v;
}


StringWrap::operator QString()
{
    return QString(val);
}

QString StringWrap::typeName()
{
    return QString("string");
}
int StringWrap::getHashCode()
{
    return qHash(val);
}
bool StringWrap::equals(CjObject *obj)
{
    StringWrap *sw = obj->dynamicCast<StringWrap>();
    if (sw == NULL) return false;
    return sw->getVal() == val;
}
QString StringWrap::getVal()
{
    return val;
}

bool StringWrap::equals(StringWrap *obj)
{
    return obj->getVal() == val;
}
CjObject *StringWrap::withMeta(IPersistentMap *meta)
{
    if (meta == _meta)
        return this;
    return (new StringWrap(this->val, meta));
}

}
